package com.googlecode.kipler.container.graph.isomorphism;

public class Pair {
	private int left, right;

	private static final int INIT_VAL = -1;

	public Pair() {

	}

	public Pair(int l, int r) {
		setLeft(l);
		setRight(r);
	}

	public static Pair initial() {
		return new Pair(INIT_VAL, INIT_VAL);
	}

	public int getLeft() {
		return left;
	}

	public void setLeft(int left) {
		this.left = left;
	}

	public int getRight() {
		return right;
	}

	public void setRight(int right) {
		this.right = right;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj != null && (obj.getClass().equals(this.getClass()))) {
			Pair other = (Pair) obj;
			return (getLeft() == other.getLeft() && getRight() == other
					.getRight());
		}
		return false;
	}

	/**
	 * @see Object#hashCode()
	 */
	@Override
	public int hashCode() {
		return 17 * 37 + getLeft() + getRight();
	}

}
